namespace OfficeLaunch.SharePoint.TwitterMap.Data
{
    public partial class LinqDataContext : Microsoft.SharePoint.Linq.DataContext
    {

        #region Extensibility Method Definitions
        partial void OnCreated();
        #endregion

        public LinqDataContext(string requestUrl) :
            base(requestUrl)
        {
            this.OnCreated();
        }

        /// <summary>
        /// A list of tweets that have been found for the AU Office Launch event (#AUOfficeLaunch)
        /// </summary>
        [Microsoft.SharePoint.Linq.ListAttribute(Name = "Office Launch Tweets")]
        public Microsoft.SharePoint.Linq.EntityList<Tweet> OfficeLaunchTweets
        {
            get
            {
                return this.GetList<Tweet>("Office Launch Tweets");
            }
        }
    }

    /// <summary>
    /// Create a new list item.
    /// </summary>
    [Microsoft.SharePoint.Linq.ContentTypeAttribute(Name = "Item", Id = "0x01")]
    [Microsoft.SharePoint.Linq.DerivedEntityClassAttribute(Type = typeof(Tweet))]
    public partial class Item : Microsoft.SharePoint.Linq.ITrackEntityState, Microsoft.SharePoint.Linq.ITrackOriginalValues, System.ComponentModel.INotifyPropertyChanged, System.ComponentModel.INotifyPropertyChanging
    {

        private System.Nullable<int> _id;

        private System.Nullable<int> _version;

        private string _path;

        private Microsoft.SharePoint.Linq.EntityState _entityState;

        private System.Collections.Generic.IDictionary<string, object> _originalValues;

        protected string _title;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate();
        partial void OnCreated();
        #endregion

        Microsoft.SharePoint.Linq.EntityState Microsoft.SharePoint.Linq.ITrackEntityState.EntityState
        {
            get
            {
                return this._entityState;
            }
            set
            {
                if ((value != this._entityState))
                {
                    this._entityState = value;
                }
            }
        }

        System.Collections.Generic.IDictionary<string, object> Microsoft.SharePoint.Linq.ITrackOriginalValues.OriginalValues
        {
            get
            {
                if ((null == this._originalValues))
                {
                    this._originalValues = new System.Collections.Generic.Dictionary<string, object>();
                }
                return this._originalValues;
            }
        }

        public Item()
        {
            this.OnCreated();
        }

        [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "ID", Storage = "_id", ReadOnly = true, FieldType = "Counter")]
        public System.Nullable<int> Id
        {
            get
            {
                return this._id;
            }
            set
            {
                if ((value != this._id))
                {
                    this.OnPropertyChanging("Id", this._id);
                    this._id = value;
                    this.OnPropertyChanged("Id");
                }
            }
        }

        [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "owshiddenversion", Storage = "_version", ReadOnly = true, FieldType = "Integer")]
        public System.Nullable<int> Version
        {
            get
            {
                return this._version;
            }
            set
            {
                if ((value != this._version))
                {
                    this.OnPropertyChanging("Version", this._version);
                    this._version = value;
                    this.OnPropertyChanged("Version");
                }
            }
        }

        [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "FileDirRef", Storage = "_path", ReadOnly = true, FieldType = "Lookup", IsLookupValue = true)]
        public string Path
        {
            get
            {
                return this._path;
            }
            set
            {
                if ((value != this._path))
                {
                    this.OnPropertyChanging("Path", this._path);
                    this._path = value;
                    this.OnPropertyChanged("Path");
                }
            }
        }

        [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "Title", Storage = "_title", Required = true, FieldType = "Text")]
        public virtual string Title
        {
            get
            {
                return this._title;
            }
            set
            {
                if ((value != this._title))
                {
                    this.OnPropertyChanging("Title", this._title);
                    this._title = value;
                    this.OnPropertyChanged("Title");
                }
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        public event System.ComponentModel.PropertyChangingEventHandler PropertyChanging;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if ((null != this.PropertyChanged))
            {
                this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }

        protected virtual void OnPropertyChanging(string propertyName, object value)
        {
            if ((null == this._originalValues))
            {
                this._originalValues = new System.Collections.Generic.Dictionary<string, object>();
            }
            if ((false == this._originalValues.ContainsKey(propertyName)))
            {
                this._originalValues.Add(propertyName, value);
            }
            if ((null != this.PropertyChanging))
            {
                this.PropertyChanging(this, new System.ComponentModel.PropertyChangingEventArgs(propertyName));
            }
        }
    }

    /// <summary>
    /// A Tweet from the twitter site
    /// </summary>
    [Microsoft.SharePoint.Linq.ContentTypeAttribute(Name = "Tweet", Id = "0x0100772F2D576B8642A199C79CCFE810029D")]
    public partial class Tweet : Item
    {

        private string _tweetAuthor;

        private string _tweetAuthorImage;

        private System.Nullable<System.DateTime> _tweetTime;

        private string _tweetID;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate();
        partial void OnCreated();
        #endregion

        public Tweet()
        {
            this.OnCreated();
        }

        [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "Tweet Author", Storage = "_tweetAuthor", FieldType = "Text")]
        public string TweetAuthor
        {
            get
            {
                return this._tweetAuthor;
            }
            set
            {
                if ((value != this._tweetAuthor))
                {
                    this.OnPropertyChanging("TweetAuthor", this._tweetAuthor);
                    this._tweetAuthor = value;
                    this.OnPropertyChanged("TweetAuthor");
                }
            }
        }

        [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "Tweet Author Image", Storage = "_tweetAuthorImage", FieldType = "Url")]
        public string TweetAuthorImage
        {
            get
            {
                return this._tweetAuthorImage;
            }
            set
            {
                if ((value != this._tweetAuthorImage))
                {
                    this.OnPropertyChanging("TweetAuthorImage", this._tweetAuthorImage);
                    this._tweetAuthorImage = value;
                    this.OnPropertyChanged("TweetAuthorImage");
                }
            }
        }

        [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "Tweet Time", Storage = "_tweetTime", FieldType = "DateTime")]
        public System.Nullable<System.DateTime> TweetTime
        {
            get
            {
                return this._tweetTime;
            }
            set
            {
                if ((value != this._tweetTime))
                {
                    this.OnPropertyChanging("TweetTime", this._tweetTime);
                    this._tweetTime = value;
                    this.OnPropertyChanged("TweetTime");
                }
            }
        }

        [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "Tweet_x0020_ID", Storage = "_tweetID", FieldType = "Text")]
        public string TweetID
        {
            get
            {
                return this._tweetID;
            }
            set
            {
                if ((value != this._tweetID))
                {
                    this.OnPropertyChanging("TweetID", this._tweetID);
                    this._tweetID = value;
                    this.OnPropertyChanged("TweetID");
                }
            }
        }
    }

}

